Skip to content

Guided channel step and image-type form: a question, a few rows, one Submit (owner, 25 Nov) - #546

Merged
guijacquemet merged 11 commits into
mainfrom
claude/channel-step-guided-submit
Nov 25, 2026
Merged

guijacquemet merged 11 commits into
mainfrom
claude/channel-step-guided-submit

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

For v0.9.0 (release PR #509 to be redone after this). This rebuilds the channel-tagging step and the image-type step of the shipped notebooks to the owner's design of 25 November 2026. It answers the Colab report: "every dropdown change saves/redraws, too many dropdowns, values reset after picking them".

Flow in the shipped notebook (stepper: MorphoBricks_Preprocessing, ..._Cellpose)

Image type (first, on Channels)

  • One answer for all folders: choose in the box, then click Validate. The Validate button replaces Use for all folders.
  • It works whatever the channel or image counts are, and also when headers differ. In that case nothing is pre-filled and Set per folder… stays folded.
  • The box, each folder's radio buttons and the RGB header override box only change the form. Nothing is written to the draft, nothing is redrawn, and each folder's note says Not validated yet.
  • Validate checks the form:
    • every folder must have a type;
    • colour is accepted only for 3-channel folders, and a refusal names every folder that is not;
    • it asks before replacing saved answers.
  • It then saves every type and the override in ONE draft write. The button then reads Validated ✓ until a choice changes, and the channel step opens.
  • Folders whose header does not fit their answer are listed as "Another step for N folders" instead of blocking the others: R_IMAGE_TYPE_CONTRADICTS_HEADER, or the RH1 override. These rules are unchanged.

Channels (after the labels)

  1. Is the channel order the same for the whole dataset? When the counts differ, it adds "The images have 3 and 4 channels".
  2. Yes opens one row per channel count.
  3. No asks Then how far does one channel order go?
    • Same order within each biological repeat folder → one row per repeat folder and count.
    • Tag every imaging unit → one row per unit.
  4. Under each dropdown are the C index and the header name, shown as evidence. Rows are pre-filled from, in order:
    • the user's choice in that row;
    • the user's choice in a broader row, marked "check it before Submit";
    • tags already saved for every unit of the row;
    • header names that equal the labels exactly, marked as such.
  5. Submit is the only save. Rows must be complete, each label once. In per-unit scope a blank row leaves that unit as it is.
    • Each header is checked with the Tag by repeat: override a listed unit from the row's tags, confirmed by the user #376 rules (repeat_fill, frozen alias snapshot).
    • Tags, aliases, tag_review and the statement are ONE draft write through TagGrid.commit(..., then), so R_DRAFT_CHANGED still applies.
    • Contradicting units are listed and left untagged. They are released only by an action on that unit: override, Confirm the same tags, Confirm all N, or its own fitting row.
    • Units whose images disagree are listed, with no other row's tags recorded for them.
  6. Reopening a draft: opening Channels writes nothing. The question is pre-answered as the draft is:
    • a fast-mode draft → Yes;
    • a strict draft → the broadest answer whose rows reproduce every saved tag, with the note "Pre-answered from your saved tags";
    • otherwise → "Saved per-unit tags are kept; answer the question to change them".

How each answer is recorded (no Spec change)

Answer Recorded as Spec basis
Yes, one channel count Fast mode: channel_layout holds the row's list; units "experiment"; a unit confirmed after a refusal gets "unit" ADR 0006, §4.3a
Yes, several counts Strict per-unit file; each unit holds its count group's list §4.4
No → per repeat / per unit Strict per-unit file §4.4
All folders colour RGB channel_layout with "experiment", written right after the image-type answer ADR 0006

Review fixes (independent review of 389bebd)

F1, blocker. A reopened strict guided draft was silently turned into fast mode.

  • Cause: an unpublished draft does not hold the hidden tick, so it opened ticked. Opening then ran an unattended sync_statement(), which wrote channel_layout = rep1's order for every unit.
  • Fix:
    • the guided step writes nothing on opening;
    • TagMatrix.tick_for_draft() reopens a draft with saved per-unit tags and no channel_layout unticked;
    • the all-colour statement is now written after the image-type answer (_types_changed) rather than on opening.
  • Proof: tests/test_notebook_channel_guide_reopen.py fails on 389bebd (4 of 6 tests: opening Channels changes the draft bytes) and passes now.
  • Not changed: the Python-interface pages' per-unit grid has the same flaw. Its fast mode tags units from their headers on opening by design, and such a draft (tags, no channel_layout) cannot be told apart from a strict one. Applying the fix there broke test_notebook_tag_untick::test_unticking_after_a_new_check_takes_back_the_no_click_tags_made_before_it, so it was reverted. The shipped notebook does not use that path.

F2. The #281 header-name-loss click, #279 reconfirm scope, aliases across fast↔strict answers, and the #257 rename and swap flows are now tested through the guided step in tests/test_notebook_channel_guide_flows.py.

F3. Covered by the F1 tests.

F4.

  • A unit whose images disagree records () as its row tags, not another repeat's. The editor and reconcile handle that.
  • The choice now reads "…biological repeat folder".

F5.

  • A broader pre-fill is marked "check it before Submit".
  • Validated ✓ shows after a save.
  • In per-unit scope, blank rows are skipped, so the other units can be saved while a refused one waits.

Tests

  • test_notebook_channel_step_acceptance.py: 17 tests clicked through steps(), every published file checked by refval.
  • test_notebook_channel_guide.py: 10 tests.
  • test_notebook_channel_guide_reopen.py: 6 tests.
  • test_notebook_channel_guide_flows.py: 5 tests.
  • test_channel_scope.py: 8 tests.
  • test_notebook_channel_no_save_on_pick.py: fails on main b683c7c, passes here.
  • The stepper test modules that drive the per-unit grid pin it with the legacy_grid fixture. The Tag by repeat: override a listed unit from the row's tags, confirmed by the user #376 tests are unchanged.

Human test script

docs/colab-release-check.md, step 10, items 1–11.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc

…Submit

Owner design of 25 November 2026 (Colab test of the v0.9.0 candidate: every
dropdown change saved and redrew the page, one row per unit, values jumped).

- Channels: "Is the channel order the same for the whole dataset?" Yes opens
  one row per channel count; No asks per biological repeat or per imaging
  unit. Dropdowns only change the form; Submit checks the rows and the image
  headers with the #376 rules (repeat_fill, refusal snapshot) and saves tags,
  aliases, tag review and statement in ONE draft write via TagGrid.commit.
  Yes with one count is fast mode (channel_layout); every other answer is a
  strict per-unit file (no Spec change).
- Image type: one answer for all folders whatever the channel or image
  counts; per-folder choices and the RGB header override box only change the
  form; Validate saves every type in one write and lists the folders whose
  header needs another step.
- The pages of the Python interface keep the per-unit grid; stepper tests of
  that grid pin it with the legacy_grid fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
test_ome_zarr_copy drives the stepper with the per-unit grid helpers
(answer_all); like the other stepper modules it takes legacy_grid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
…546)

F1: the fast-mode tick is hidden in the guided step and only Submit sets
it, so an unpublished draft does not hold it. A reopened per-repeat,
per-unit or one-list-per-count draft opened ticked, and opening Channels
wrote channel_layout = the first unit's order with every unit
"experiment": Check and save published every unit in that order. Opening
the guided step now writes nothing; a draft with saved per-unit tags and
no channel_layout reopens unticked (TagMatrix.tick_for_draft); the guide
is pre-answered as the draft is (channel_scope.scope_of_draft). Every
folder colour states R, G, B right after the image-type answer.

F2: the #281, #279, fast/strict alias and #257 rename/swap flows are
tested through the guided step. F4: a unit whose images disagree records
no other row's tags; "Same order within each biological repeat folder".
F5: a row filled from a broader choice says so; per unit, a blank row
keeps that unit; the image type's button reads "Validated ✓" after a save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
F1: opening Channels on a reopened draft calls the draft writer zero
times (per repeat, per unit, mixed counts with Yes, fast, all colour);
the byte comparison alone would also pass a rewrite of the same bytes.
F4: a unit whose images disagree is refused with no row's tags (Yes and
per repeat), in memory and in the draft's tag review, and its editor
opens blank once its images agree; the choice names the "biological
repeat folder". F5: a row pre-filled from a broader choice says "check
it before Submit"; the image type's button reads "Validated ✓" after a
save and "Validate" after a change of the form.

Each fails on 389bebd (the reviewed head) and passes on 1ad79df.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
…-guided-submit

CHANGELOG.md: both sides' Unreleased entries are kept (the guided channel
step's entries, then the Cellpose stepper's).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
The image type's button is Validate (formerly Use for all folders) in
the first bullet and in item 7. Item 11 adds the check of review F4: a
folder whose images disagree is listed untagged with no other folder's
tags, and its override opens blank once its images agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
…/channel-step-guided-submit

CHANGELOG.md: both sides' Unreleased entries are kept (the guided
channel step's, then the restore's and the Cellpose stepper's). The
code merged without a conflict; notebook_steps.py and notebook_ui.py
carry both the guided step and the restore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
With #547, setting the output folder restores the check and the saved
answers with no click. A per-repeat draft restored this way, then the
axes confirmed and Channels opened, calls the draft writer zero times,
stays unticked, is pre-answered "No, per repeat folder" with the saved
orders, and publishes each repeat's own order (no channel_layout).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a

Copy link
Copy Markdown
Contributor Author

Review fixes: status at e40f1ad

The code fixes for every finding were already in 1ad79df. This round checked them, filled the gaps in the tests, and merged main twice: a5ee781 (#548) and a1e9d3f (#547).

Finding Fix (code in 1ad79df) Proof
F1 blocker: reopening a strict draft turned it into fast mode Opening the guided step writes nothing: no trust_headers/sync_statement in open(). The mode comes from the draft (TagMatrix.tick_for_draft). The question is pre-answered as the draft is (scope_of_draft). R,G,B is stated after the image-type answer test_notebook_channel_guide_reopen.py: reopened per-repeat, per-unit and mixed-count drafts. New: test_opening_channels_on_a_reopened_draft_writes_no_byte[…] spies on save_draft and asserts 0 calls, so a rewrite of the same bytes would also fail it. New: a per-repeat draft restored through #547 also opens strict with no write. test_7 (all colour) still publishes R,G,B
F2 guided-step tests — test_notebook_channel_guide_flows.py: #281 header-name loss, #279 reconfirm scope, aliases across fast↔strict, #257 rename and swap
F4 another repeat's tags for a unit whose images disagree Refused with (), not the first row's tags; the override handles it. The choice reads "…biological repeat folder" New test_notebook_channel_guide_marks.py: covers Yes and per-repeat, in memory and in the draft's tag_review. The editor opens blank once the images agree. Also tests the wording
F5 marks Broader pre-fill says "check it before Submit"; the button reads Validated ✓ New tests in test_notebook_channel_guide_marks.py: the broader pre-fill mark, and Validated ✓ → Validate on a change → Validated ✓ when changed back

On 389bebd (the reviewed head), 13 of the guided-step tests fail: the reopen tests (per-repeat, per-unit, mixed count, listed unit), the 0-write test for per-repeat, per-unit and mixed count, every F4/F5 test, and #281. They all pass on 1ad79df and here.

Merges:

Checks:

Docs: docs/colab-release-check.md step 10 now says Validate in place of Use for all folders, and item 11 adds the F4 check.

Not changed: the Python-interface pages' per-unit grid still writes on opening in fast mode, as described in the PR body. The shipped notebook does not use that path.

Left as a draft; not merged.


Generated by Claude Code

Review of #546 at e40f1ad (Medium): on a reopened per-repeat draft,
picking Yes, filling its row with rep1's order and going back to No,
per repeat folder showed rep1's order in every repeat row, because
seed() ranked a broader choice of the session above the row's saved
tags; "Pre-answered from your saved tags" stayed, and one Submit
published rep1's order for every unit.

seed() now ranks the row's own choice, then the tags every unit of the
row has saved, then a broader choice, then the header names. The
"Pre-answered" note goes at the first change of the answer or of a row.
The channel_scope docstrings say "biological repeat folder".

Tests: the exact sequence (fails on e40f1ad, also with only the note
fixed), the note taken back by a pick, and the seed order in
test_channel_scope. User guide, CHANGELOG and release check step 10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a

Copy link
Copy Markdown
Contributor Author

Review of e40f1ad, Medium: fixed in 8176eed

Finding: an abandoned switch to Yes published rep1's order for every repeat.

  • On a reopened per-repeat draft: Yes, fill the row with rep1's order, back to No / repeat.
  • Every repeat row then showed rep1's order, because seed() ranked a broader choice from this session above the row's saved tags.
  • The "Pre-answered from your saved tags" note stayed, and one Submit published DNA,ACTIN,PHASE everywhere.

Fix:

  • channel_scope.seed now fills a row from, in order:
    1. the row's own choice;
    2. the tags every unit of the row has saved ("as saved");
    3. a broader choice from this session ("check it before Submit");
    4. the header names.
  • This applies whether or not the draft was reopened. A Submit earlier in the same session leaves the same risk otherwise.
  • With nothing saved, a row still starts from the broader choice (acceptance test 8).
  • The "Pre-answered" note is cleared the first time the answer or a row changes.
  • The channel_scope docstrings now say "biological repeat folder".

Tests:

  • test_an_abandoned_yes_never_replaces_the_saved_repeat_orders replays the exact sequence through Submit and publish. It fails on e40f1ad, and still fails there with only the note fixed (rep2/rep3 rows show rep1's order).
  • test_a_pick_in_a_pre_answered_row_takes_the_note_back.
  • The seed order in test_channel_scope.py.
  • All three fail on e40f1ad.

Checks:

  • Focused channel-step, notebook-UI, restore, tag-review and check-save tests: 485 passed, 0 skipped.
  • ruff and tools/check.py --rules: clean.
  • No new full check, as agreed for this local change.

Docs: user guide, CHANGELOG, and release check step 10 item 11 (this exact sequence as a manual check).

Left as a draft; not merged.


Generated by Claude Code

@guijacquemet
guijacquemet marked this pull request as ready for review November 25, 2026 16:53
@guijacquemet
guijacquemet merged commit c8c3808 into main Nov 25, 2026
3 checks passed
@guijacquemet
guijacquemet deleted the claude/channel-step-guided-submit branch November 25, 2026 16:53
guijacquemet pushed a commit that referenced this pull request Nov 25, 2026
…547, #546) into the v0.9.0 release branch

No conflicts. The notebooks' RELEASE_REF, the RELEASE_CALLS entry and the pin assertion are
put back to their pre-pin values (the release branch carried commit B's pins), so that the
next commit is the preparation commit A and commit B moves them. CHANGELOG: #543 and #544
were not in the v0.9.0 section and are added; the others already were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
guijacquemet pushed a commit that referenced this pull request Nov 25, 2026
The full python tools/check.py on the tree of the merge commit 5e11bc9 (main at c8c3808 with
#528, #534, #543, #545, #544, #530, #548, #547 and #546): Ruff clean, 760 files formatted,
pytest 8813 passed and 12 skipped, code rules passed; the Spec modules 2122 passed, 0 skipped;
the notebook pin and version tests 49 passed. Docs only: this commit is the v0.9.0 preparation
commit A that commit B pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
@guijacquemet guijacquemet mentioned this pull request Nov 25, 2026
3 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants